/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.system;

import com.enation.app.javashop.client.system.EmailClient;
import com.enation.app.javashop.core.client.fallback.system.EmailClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.base.SceneType;
import com.enation.app.javashop.model.base.vo.EmailVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author fk
 * @version v2.0
 * @Description: 邮件
 * @date 2018/8/13 16:25
 * @since v7.0.0
 */
@FeignClient(value = "system-service", fallbackFactory = EmailClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface EmailClientFeignImpl extends EmailClient {

    /**
     * 邮件发送实现，供消费者调用
     *
     * @param emailVO
     */
    @Override
    @RequestMapping(value = "/client/email", method = RequestMethod.POST)
    void sendEmail(@RequestBody EmailVO emailVO);

    /**
     * 验证邮箱验证码
     *
     * @param scene  业务场景
     * @param email  电子邮箱
     * @param code   电子邮箱验证码
     * @return 是否通过校验 true通过，false不通过
     */
    @Override
    @RequestMapping(value = "/client/email/valid", method = RequestMethod.POST)
    boolean valid(@RequestParam("scene") String scene, @RequestParam("email")String email, @RequestParam("code")String code);

    @Override
    @RequestMapping(value = "/client/email/send", method = RequestMethod.POST)
    void sendEmailMessage(@RequestParam("by_name")String byName, @RequestParam("email")String email, @RequestParam("scene_type")SceneType sceneType);
}
